import request from '@/utils/request.ts'
import {
  trademarkResponseData,
  trademark,
} from '@/api/product/trademark/type.ts'
// 获取品牌
export const getTrademark = (page: number, limit: number) =>
  request.get<any, trademarkResponseData>(
    `/admin/product/baseTrademark/${page}/${limit}`,
  )
//添加或修改品牌
export const addOrUpdateTrademark = (data: trademark) => {
  if (data.id) {
    return request.put<any, any>('/admin/product/baseTrademark/update', data)
  } else {
    return request.post<any, any>('/admin/product/baseTrademark/save', data)
  }
}
//删除品牌
export const deleteTrademark = (id: number) =>
  request.delete(`/admin/product/baseTrademark/remove/${id}`)
